package xyz.xiaoshengfu.xrpc.common;

import java.util.List;
import java.util.Set;

import redis.clients.jedis.JedisPubSub;

/**
 * <p>Title: JedisClient</p>
 * <p>Description: Jedis工具类接口</p>
 * @author xiaoshengfu(2439323118@qq.com)
 * @date 2020年3月4日
 */
public interface JedisClient {

	public Set<String> keys(String pattern);

	String set(String key, String value);

	String setex(String key, int seconds, String value);

	String get(String key);

	Boolean exists(String key);

	Long expire(String key, int seconds);

	Long ttl(String key);

	Long incr(String key);

	Long hset(String key, String field, String value);

	String hget(String key, String field);

	Long hdel(String key, String... field);

	Boolean hexists(String key, String field);

	List<String> hvals(String key);

	Long del(String key);

	/**
	 *<p>Title: publisher</p>
	 *<p>Description: 向频道发布信息</p>
	 * @param channel
	 * @param message
	 */
	public void publisher(String channel, String message);

	/**
	 *<p>Title: subscribe</p>
	 *<p>Description: 从频道订阅信息</p>
	 * @param channel
	 * @param jedisPubSub
	 */
	public void subscribe(String channel, JedisPubSub jedisPubSub);
}
